<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>28_document选择器.html</title>
  </head>
  <body>
    <button id="btn1">测试btn1</button>
    <button class="btn">测试btn</button>
    <button a="1">测试</button>
    <button b="2">测试</button>
    <button b="3">测试</button>
    <button b="4">测试</button>
    <button>测试</button>
    <button>测试</button>
    <button>测试</button>
    <button>测试</button>
    <button>测试</button>
    <button>测试</button>
    <script>
      document.querySelector("#btn1").oncilck = () => {
        alert("测试btn1");
      };
      document.querySelector(".btn").onclick = () => {
        alert("测试btn");
      };

      document.querySelector("button[b='2']").onclick = () => {
        alert("测试123");
      };

      // 标签选择器
      // 类选择器
      // id选择器 唯一的
      // 多条件选择器
    </script>
  </body>
</html>
